package com.spzx.channel.service.impl;

import com.spzx.channel.service.CategoryService;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;

import com.spzx.product.api.domain.vo.CategoryVo;
import com.spzx.product.api.service.RemoteCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private RemoteCategoryService remoteCategoryService;

    @Override
    public List<CategoryVo> getCategoryTree() {
        R<List<CategoryVo>> categoryTree = remoteCategoryService.getCategoryTree(SecurityConstants.INNER);
        List<CategoryVo> data = categoryTree.getData();
        return data;

    }
}
